import os

def find_txt_files(directory):
    txt_files = []
    for root,dirs,files in os.walk(directory):
        for file in files:
            if file.endswith('.txt'):
                txt_files.append(os.path.join(root,file))
    return txt_files


if __name__ == '__main__':
    txt_files = find_txt_files('./alltxt')
    print(txt_files)